<html>
<head>
<title>Clipboard Test</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<script src="https://cdn.bootcss.com/clipboard.js/1.7.1/clipboard.min.js"></script>
</head>
<body>    
<span id="one">你看 你看 月亮的脸</span>
<button class="btn" data-clipboard-target="#one">一键复制</button><br><br>
<!--  -->
<span id="two">不看 不看 就是不看</span>
<button class="btn" data-clipboard-target="#two">一键复制</button>
<script>
  var clipboard = new Clipboard('.btn');
  clipboard.on('success', function(e) {     
    alert('Text:' + e.text);    
    e.clearSelection();
  });
</script>
</body>
</html